
class TypeConversion:

    @staticmethod
    def toFloat(value):
        if value is None or value == "": 
            return ""
        try:
            return float(value)
        except (ValueError, TypeError):
            return ""
        
    @staticmethod
    def toInt(value):
        if value is None or value == "":
            return ""
        try:
            return int(value)
        except (ValueError, TypeError):
            return ""

    @staticmethod
    def roundToString(value, decimal):
        newValue = TypeConversion.toFloat(value)
        if newValue == "":
            return ""
        if decimal == 0:
            return str(round(newValue))
        return str(round(newValue, decimal))